package com.shuwen.gcdj.common.util.paging;

import com.shuwen.gcdj.bean.PagingReq;

public class PagingUtil {
    private PagingUtil() {

    }

    public static void withDefault(PagingReq req) {
        if (req == null) {
            return;
        }

        if (req.getPageNum() == null || req.getPageNum() <= 0) {
            req.setPageNum(1);
        }

        if (req.getPageSize() == null || req.getPageSize() <= 0) {
            req.setPageSize(20);
        }
    }
}
